From: Olaf Hering Date: Wed, 22 Jun 2011 13:47:09 +0000 (+0100) Subject: xenpaging: add xs_handle to struct xenpaging X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=faa19e60daf043236a3a8485069966796d8df219;p=xen.git xenpaging: add xs_handle to struct xenpaging A xs_handle is currently used in the xc_mem_paging_flush_ioemu_cache() function and will be used by a subsequent patch. Add it to struct xenpaging. Signed-off-by: Olaf Hering Committed-by: Ian Jackson Acked-by: Ian Campbell --- diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index d83448f8f5..04d362356a 100644 --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -92,6 +93,14 @@ static xenpaging_t *xenpaging_init(domid_t domain_id) paging = malloc(sizeof(xenpaging_t)); memset(paging, 0, sizeof(xenpaging_t)); + /* Open connection to xenstore */ + paging->xs_handle = xs_open(0); + if ( paging->xs_handle == NULL ) + { + ERROR("Error initialising xenstore connection"); + goto err; + } + p = getenv("XENPAGING_POLICY_MRU_SIZE"); if ( p && *p ) { @@ -221,6 +230,8 @@ static xenpaging_t *xenpaging_init(domid_t domain_id) err: if ( paging ) { + if ( paging->xs_handle ) + xs_close(paging->xs_handle); xc_interface_close(xch); if ( paging->mem_event.shared_page ) { @@ -277,6 +288,9 @@ static int xenpaging_teardown(xenpaging_t *paging) } paging->mem_event.xce_handle = NULL; + /* Close connection to xenstore */ + xs_close(paging->xs_handle); + /* Close connection to Xen */ rc = xc_interface_close(xch); if ( rc != 0 ) diff --git a/tools/xenpaging/xenpaging.h b/tools/xenpaging/xenpaging.h index 855966772a..2d7bead7a0 100644 --- a/tools/xenpaging/xenpaging.h +++ b/tools/xenpaging/xenpaging.h @@ -36,6 +36,7 @@ typedef struct xenpaging { xc_interface *xc_handle; + struct xs_handle *xs_handle; xc_platform_info_t *platform_info; xc_domaininfo_t *domain_info;